package com.bacon.gmall.task.timing;

import com.bacon.gmall.common.config.RabbitConst;
import com.bacon.gmall.common.utils.RabbitUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author： bacon、
 * @version： 1.0
 * @create： 2021-01-13 08:33
 * @description:
 */
@Component
@EnableScheduling
public class taskSeckill {

    @Autowired
    private RabbitUtil rabbitUtil;

    @Scheduled(cron = "0/5 * * * * ?")
    public void test(){
        System.out.println("定时任务");
        rabbitUtil.sendMessage(RabbitConst.EXCHANGE_DIRECT_TASK,
                RabbitConst.ROUTING_TASK_1,"");
    }

}
